package com.huabo.contract.mysql.mapper;

import com.hbfk.util.PageInfo;
import com.huabo.contract.mysql.entity.TblContractLendMySql;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-03-21
 */
public interface TblContractLendMySqlMapper extends BaseMapper<TblContractLendMySql> {

    @UpdateProvider(type=TblContractLendMySqlMapperSqlConfig.class,method="updateTblContractLead")
    void updateTblContractLead(TblContractLendMySql lend);

    @InsertProvider(type=TblContractLendMySqlMapperSqlConfig.class,method="saveTblContractLead")
    void saveTblContractLead(TblContractLendMySql lend);

    @SelectProvider(type=TblContractLendMySqlMapperSqlConfig.class,method= "findByContractId")
    List<TblContractLendMySql> findByContractId(PageInfo<TblContractLendMySql> pageInfo);

    @SelectProvider(type=TblContractLendMySqlMapperSqlConfig.class,method= "findCountByContractId")
    Integer findCountByContractId(PageInfo<TblContractLendMySql> pageInfo);

    @Select("SELECT * FROM TBL_CONTRACT_LEND WHERE LENDID = #{lendid}")
    TblContractLendMySql findById(String lendid);
}
